﻿@using System.Web.Mvc.Html;
@using System.Web.WebPages.Html;
@using System.Web.Mvc;
@using DddCms.Presentation.Areas.DddCms.Models.UIComponent.Grid;

@helper Grid(Func<GridViewModelBuilder, GridViewModelBuilder> builderViewModel)
{
    GridViewModel gridViewModel = builderViewModel(new GridViewModelBuilder()).ViewModel;
    <div class="DataGridHeader">
        <div class="DataGridContent">
            <table cellpadding="0" cellspacing="0" class="DataGridHeaderTable">
                <tr>
                    @foreach (GridHeaderViewModel gridHeaderViewModel in gridViewModel.Headers)
                    {
                        GridRenderHeader(gridHeaderViewModel);
                    }
                </tr>
            </table>
        </div>
    </div>
}
@helper GridRenderHeader(GridHeaderViewModel gridHeaderViewModel)
{
    <td class="DataGridTh">
        <table class="DataGridThHoverGrid" style="width: 100%; overflow: hidden; table-layout: fixed">
            <tr>
                <td>
                    <div class="TdContent">
                        <div class="TdContentText">
                        </div>
                    </div>
                </td>
                <td class="hiddenTd">
                </td>
            </tr>
        </table>
    </td>
}